<!DOCTYPE html>
<html>
<head>
<title>{$site_name}</title>
<meta name="keywords" content="{$site_seo_keywords}" />
<meta name="description" content="{$site_seo_description}">

 
<tc_include file="Public:head" />
</head>

<body class="body-white" id="top">
	<tc_include file="Public:nav" />

		<div class="container tc-main">
                <div class="row">
                    <div class="span3">
	                    <tc_include file="Public:usernav"/>
                    </div>
                    <div class="span9" >
                           <div class="tabs">
                               <ul class="nav nav-tabs">
                                   <li class="active"><a href="#one" data-toggle="tab"><i class="fa "></i>绑定微信号</a></li>
                                   <li ><a href="#two" data-toggle="tab"><i class="fa "></i>朋友圈认证</a></li>
                               </ul>
                               <div class="tab-content">
                                   <div class="tab-pane active" id="one">
                                   		
                                   		 <button type="button" class="btn btn-primary btn-lg" style="margin-bottom:15px; border-radius:5px;" id="addWechat"  >添加微信号</button>
                                   		
                                   		<table class="table table-bordered table-striped table-hover">
									    <thead>
									      <tr>
									       
									        <th width="80">用户昵称</th>
									        <th width="50">性别</th>
									        <th width="190">绑定时间</th>
									        <th>朋友圈认证 </th>
									      </tr>
									    </thead>
									    <tbody>
									  <foreach name="welist" item="vo">
										 <tr>
										 <td>
										 	<if condition="$vo['headimgurl'] neq '' ">
										 		<img src="{$vo.headimgurl}" width="80" height="80" />
										 	</if>
											<br/>
											{$vo.nickname}
										 </td>
										 <td>
										 	<if condition="$vo['sex'] eq 1 ">
										 		男	
											<elseif condition="$vo['sex'] eq 2 " />
												女
											<else />
												未知	
											</if>
										 </td>
										 <td>
											{$vo.addtime|date='Y-m-d H:i:s',###}
										 </td>
										 <td>
										 <if condition="$vo['status'] eq 2">
										 	已认证
										 <else />
										 <a href="{:U('user/profile/friendAuth',array('wid'=>$vo['wid']))}">申请</a>
										 </if>
										 
										 </td>
										 </tr>
									  </foreach>
									    </tbody>
									  </table>
                                   		
                                 </div>

   									<div class="tab-pane " id="two"> 
                               
                               	<table class="table table-bordered table-striped table-hover">
									    <thead>
									      <tr>
									       <th width="80">微信号</th>
									        <th width="80">用户昵称</th>
									        <th width="50">性别</th>
									        <th width="50">价格</th>
									        <th width="190">认证时间</th>
									        <th>状态</th>
									        
									      </tr>
									    </thead>
									    
									    
									    <tbody>
									    <php>$i=0;</php>
									     <foreach name="welist" item="vo">
									     <if condition="$vo['status'] neq 3">
										 <tr>
										 <td>{$vo.hao}</td>
										 <td>
										 	
											{$vo.nickname}
										 </td>
										 <td>
										 	<if condition="$vo['sex'] eq 1 ">
										 		男	
											<elseif condition="$vo['sex'] eq 2 " />
												女
											<else />
												未知	
											</if>
										 </td>
										 <td>{$vo.price}</td>
										 <td>
											{$vo.auttime|date='Y-m-d H:i:s',###}
										 </td>
										 <td>
										 	{$status[$vo['status']]}
										 </td>
										 </tr>
										  <php>$i++;</php>
										 </if>
									  </foreach>
									   <if condition="$i eq 0">
									   	<tr>
									   		<td colspan="6">
									   			还没有认证朋友圈
									   		</td>
									   	</tr>
									   </if>
                               			</tbody>
                               		</table>	
                               		</div>
                         </div>		
                             
                         
                                  
                             
                                   		
                                   		
                                   		
                                   		
             <div id="myModal400011" class="modal hide" style="top:200px;">
              <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">&times;</button>
                <h3 style="text-align: center;">请扫描下面的二维码</h3>
                <label style="text-align: center;">
                   <img src="" />
                </label>
              </div>
              <div class="modal-body"></div>
            </div>
                                   
                                   
                                   	
                                   					
                           </div>
                    </div>
                </div>

		<tc_include file="Public:footer" />

	</div>
	<!-- /container -->

	<tc_include file="Public:scripts" />
	<script type="text/javascript">
		
			$(function(){
				var geturl="{:U('user/Profile/creatErcode')}";
				var statuUrl="{:U('user/Profile/getStatus')}";
				$("#addWechat").click(function(){
					ajax(geturl,{},function(msg){
							if (msg.status) {
								var mode = $('#myModal400011');
								mode.find("img").attr("src", msg.info);
								mode.modal('toggle');
								getstatus();
								
							}else{
								$.showErr("未获取到数据");
							}
						});
					});
					
			var ajax=function(posturl,postdata,func)
				{
					$.ajax({
					type:"POST",
				    url: posturl,
					data:postdata,
					dataType:"JSON",
					success:func,
					error:function(e)
					{
						$.showErr(e);	
					}
				  });
				}	
			var getstatus=function()
				{
					ajax(statuUrl,{},function(msg){
						if(msg.status)
						{
							 window.location.reload();
						}else{
							setTimeout(
								function(){
									getstatus();
								},
								2000
							);
						}
					})
				
			
				}	
		
			});
	
	
	</script>
	
	
</body>
</html>